﻿@model SportClubMvc.Model.SportsClubClasses.NewsModel
<div class="row">
    <div class="span8">
        <h3>Legg til nyhet</h3>
        <hr />
        @{
            var creator = User.Identity.IsAuthenticated ? User.Identity.Name : "Anonym";
        }
        <p>
            Nyhet opprettes som <a href="#">@creator.</a>
        </p>

        <p>&nbsp;</p>

        @using (Html.BeginForm("AddNews", "News", FormMethod.Post, new { @class = "form-horizontal", id = "newsForm", @enctype = "multipart/form-data" }))
        {
            <div class="control-group">
                <div class="control-label">
                    Overskrift:
                </div>
                <div class="controls">
                    @Html.TextBoxFor(x => x.Header)
                </div>
            </div>
            <div class="control-group">
                <div class="control-label">
                    Ingress:
                </div>
                <div class="controls">
                    @Html.TextAreaFor(x => x.Ingress)
                </div>
            </div>
            <div class="control-group">
                <div class="control-label">
                    Nyhetsbilde:
                </div>
                <div class="controls">
                    <input type="file" name="file" />
                </div>
            </div>
            <hr />
            <div class="control-group">
                <div class="control-label">
                    Tekst:
                </div>
                <div class="controls">
                    @Html.TextAreaFor(x => x.Text, new { id = "wysiwyg", @cols = "50", @rows = "15" })
                </div>
            </div>
            
            <div class="button">
                <a href="#" onclick="SubmitNews()">Lagre</a>
            </div>
        }
    </div>
    <div class="span3">
    </div>
</div>

